*************************************************************************
*																		*
*					Campaign Panel Book Master Chapter 6				*
*																		*
*************************************************************************	

cd "${path}\Reproducible Do-Files\"

clear mata
clear matrix
set more off
set scrollbufsize 2000000

***Run regressions for 2009 first
use "Data/ZA5305_en_v5-0-0.dta", clear

**Create party choice variable and dynamics party choice

do "${path}\Reproducible Do-Files\Chapter 6\choice09.do"

**Create michigan model variables

do "${path}\Reproducible Do-Files\Chapter 6\michigan09.do"

**Create communication variables

do "${path}\Reproducible Do-Files\Chapter 6\komm_variablen09.do"

**Merge single datasets and transform them into long-format

do "${path}\Reproducible Do-Files\Chapter 6\longformat09.do"

**Run regressions

do "${path}\Reproducible Do-Files\Chapter 6\xtlogit09.do"



***Now we run the regressions for 2013

use "${data}\ZA5704_en_v3-2-0.dta", clear


**Create turnout variable and dynamics turnout

do "${path}\Reproducible Do-Files\Chapter 6\choice13.do"

**Create michigan model variables

do "${path}\Reproducible Do-Files\Chapter 6\michigan13.do"

**Create communication variables

do "${path}\Reproducible Do-Files\Chapter 6\komm_variablen13.do"

**Create event variables

do "${path}\Reproducible Do-Files\Chapter 6\events13.do"

**Merge single datasets and transform them into long-format

do "${path}\Reproducible Do-Files\Chapter 6\longformat13.do"

**Run regressions

do "${path}\Reproducible Do-Files\Chapter 6\xtlogit13.do"
